package com.example.aixiangshou.runninggame;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.x_memteor.base_master.WebActivity;
import com.x_memteor.base_master.base.BaseActivity;
import com.x_memteor.base_master.utils.ToastUtils;

import butterknife.BindView;
import butterknife.OnClick;

public class SettingActivity extends BaseActivity implements CompoundButton.OnCheckedChangeListener {

    @BindView(R.id.imv_close)
    ImageView imvClose;
    @BindView(R.id.tv_facebook_title)
    TextView tvFacebookTitle;
    @BindView(R.id.tv_facebook_center)
    TextView tvFacebookCenter;
    @BindView(R.id.lay_face_book)
    LinearLayout layFaceBook;
    @BindView(R.id.tv_google_title)
    TextView tvGoogleTitle;
    @BindView(R.id.tv_google_center)
    TextView tvGoogleCenter;
    @BindView(R.id.lay_face_google)
    LinearLayout layFaceGoogle;
    @BindView(R.id.checkbox_music)
    CheckBox checkboxMusic;
    @BindView(R.id.checkbox_sound)
    CheckBox checkboxSound;
    @BindView(R.id.edit_nickname)
    EditText editNickname;
    @BindView(R.id.tv_terms)
    TextView tvTerms;
    @BindView(R.id.tv_privacy)
    TextView tvPrivacy;
    @BindView(R.id.edit_id)
    EditText editId;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public void initRootView() {
        setContentView(R.layout.activity_setting);
    }

    @Override
    public void initView() {

    }

    @Override
    public void initData() {

    }

    @Override
    public void initListener() {
        checkboxMusic.setOnCheckedChangeListener(this);
        checkboxSound.setOnCheckedChangeListener(this);
    }

    @OnClick({R.id.imv_close, R.id.lay_face_book, R.id.lay_face_google, R.id.tv_terms, R.id.tv_privacy})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.imv_close:
                finish();
                break;
            case R.id.lay_face_book:
                break;
            case R.id.lay_face_google:
                break;
            case R.id.tv_terms:
                startActivity(new Intent(SettingActivity.this, WebActivity.class));
                break;
            case R.id.tv_privacy:
                startActivity(new Intent(SettingActivity.this, WebActivity.class));
                break;
        }
    }

    @Override
    public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
        if (isChecked) {
            buttonView.setBackgroundColor(getResources().getColor(R.color.main_sky));
            buttonView.setText("ON");
        } else {
            buttonView.setBackgroundColor(getResources().getColor(R.color.main_fense));
            buttonView.setText("OFF");
        }
    }
}
